﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using System.Web.Security;
using Tasks.UI.Models.Account;
using Tasks.Business;
using Tasks.Common.Entitys;
using System.Collections;
using Tasks.Core;
using Tasks.Common;
using Tasks.UI.Models;

namespace Tasks.UI.Controllers
{
    public class BaseController : Controller
    {

        protected override void OnException(ExceptionContext filterContext)
        {

            Log.WriteLog(filterContext.Exception);
            // 执行基类中的OnException
            base.OnException(filterContext);

            // 重定向到异常显示页或执行其他异常处理方法
            Response.Redirect("/Home/Error");
        }

        public string FormatTime(DateTime? date)
        {
            return date.HasValue ? date.Value.ToShortDateString() : "";
        }
    }
}